﻿using System;

namespace Aeon.Emulator.Instructions.FPU
{
    internal static class Fsincos
    {
        [Opcode("D9FB", OperandSize = 16 | 32, AddressSize = 16 | 32)]
        public static void SineCosine(VirtualMachine vm)
        {
            double st0 = vm.Processor.FPU.ST0;
            double sine = Math.Sin(st0);
            double cosine = Math.Cos(st0);

            vm.Processor.FPU.ST0 = sine;
            vm.Processor.FPU.Push(cosine);

            vm.Processor.InstructionEpilog();
        }
    }
}
